package com.carlinfo.demo.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

public class AKing
{
	private int id;
	private int dynastyId;
	private String name;
	private int age;
	private double height;
	private String miaoHao;
	private String nianHao;
	private String context;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	
	/**
	 * 
	 */
	private String statusStr;
	private Map<String, ADynastyEnum> statusMap;
	private ADynasty dynasty;
	
	public int getId()
	{
		return id;
	}
	public void setId(int id)
	{
		this.id = id;
	}
	public int getDynastyId()
	{
		return dynastyId;
	}
	public void setDynastyId(int dynastyId)
	{
		this.dynastyId = dynastyId;
	}
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}
	public int getAge()
	{
		return age;
	}
	public void setAge(int age)
	{
		this.age = age;
	}
	public double getHeight()
	{
		return height;
	}
	public void setHeight(double height)
	{
		this.height = height;
	}
	public String getMiaoHao()
	{
		return miaoHao;
	}
	public void setMiaoHao(String miaoHao)
	{
		this.miaoHao = miaoHao;
	}
	public String getNianHao()
	{
		return nianHao;
	}
	public void setNianHao(String nianHao)
	{
		this.nianHao = nianHao;
	}
	public String getContext()
	{
		return context;
	}
	public void setContext(String context)
	{
		this.context = context;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getUpdateTime()
	{
		return updateTime;
	}
	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}
	public Date getPubTime()
	{
		return pubTime;
	}
	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}
	@Override
	public String toString()
	{
		return "AKing [id=" + id + ", dynastyId=" + dynastyId + ", name=" + name + ", age=" + age + ", height=" + height
				+ ", miaoHao=" + miaoHao + ", nianHao=" + nianHao + ", context=" + context + ", status=" + status
				+ ", createTime=" + createTime + ", updateTime=" + updateTime + ", pubTime=" + pubTime + "]";
	}
	public ADynasty getDynasty()
	{
		return dynasty;
	}
	public void setDynasty(ADynasty dynasty)
	{
		this.dynasty = dynasty;
	}
	public String getStatusStr()
	{
		ADynastyEnum[] values = ADynastyEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			ADynastyEnum enumTemp = values[i];
			/* 根据值和变量名判断 */
			if(enumTemp.getValue() == this.status 
				&& enumTemp.toString().startsWith("STATUS_"))
			{
				/* 含义 */
				this.statusStr = enumTemp.getInfo() ; 
				/* 找到以后就break */
				break ; 
			}
		}
		return statusStr;
	}
	public Map<String, ADynastyEnum> getStatusMap()
	{
		this.statusMap = new TreeMap<String,ADynastyEnum>();
		ADynastyEnum[] values = ADynastyEnum.values() ; 
		for (int i = 0; i < values.length; i++)
		{
			ADynastyEnum enumTemp = values[i];
			/* 根据值和变量名判断 */
			if(enumTemp.toString().startsWith("STATUS_"))
			{
				 this.statusMap.put(enumTemp.getValue() + "", enumTemp);
			}
		}
		return statusMap;
	}
}
